home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / QT2MPEG.ZIP / mpeg_encode.diff < prev    next >
Text File  |  1994-12-27  |  2KB  |  74 lines

  1. diff -u /usr/src/mpeg_encode-1.3/src/main.c mpeg/main.c
  2. --- /usr/src/mpeg_encode-1.3/src/main.c    Tue Mar 15 01:26:51 1994
  3. +++ mpeg/main.c    Fri Jul  1 12:47:34 1994
  4. @@ -91,6 +91,8 @@
  5.  boolean    computeMVHist = FALSE;
  6.  int baseFormat;
  7.  
  8. +int wait_and_destroy= 0;        /* set by flag, for qt2mpeg */
  9. +
  10.  /*===============================*
  11.   * INTERNAL PROCEDURE prototypes *
  12.   *===============================*/
  13. @@ -161,6 +163,9 @@
  14.          } else {
  15.          Usage();
  16.          }
  17. +        } else if ( strcmp(argv[index], "-wait") == 0 ) {
  18. +            wait_and_destroy= 1;
  19. +            index++; 
  20.      } else if ( strcmp(argv[index], "-frames") == 0 ) {
  21.          if ( (function != ENCODE_FRAMES) || (whichGOP != -1) ) {
  22.          Usage();
  23. diff -u /usr/src/mpeg_encode-1.3/src/readframe.c mpeg/readframe.c
  24. --- /usr/src/mpeg_encode-1.3/src/readframe.c    Tue Mar 15 01:26:55 1994
  25. +++ mpeg/readframe.c    Fri Jul  1 12:55:24 1994
  26. @@ -68,7 +68,10 @@
  27.  #define PPM_READ_STATE_MAXVAL    3
  28.  #define PPM_READ_STATE_DONE    4
  29.  
  30. +#define WAITING                 if (wait_and_destroy) 
  31.  
  32. +extern int wait_and_destroy;
  33. +
  34.  /*==================*
  35.   * STATIC VARIABLES *
  36.   *==================*/
  37. @@ -175,11 +178,21 @@
  38.          exit(1);
  39.      }
  40.      } else {
  41. -    if ( (ifp = fopen(fullFileName, "r")) == NULL ) {
  42. -        fprintf(stderr, "ERROR:  Couldn't open input file %s\n",
  43. -            fullFileName);
  44. -        exit(1);
  45. -    }
  46. +WAITING  fprintf(stderr,"mpeg: waiting for input: %s\n",fullFileName);
  47. +WAITING  while (1) {
  48. +          if ( (ifp = fopen(fullFileName, "r")) == NULL ) { 
  49. +WAITING     fclose(ifp); 
  50. +WAITING     continue; 
  51. +            fprintf(stderr, "ERROR:  Couldn't open input file %s\n",
  52. +                            fullFileName);
  53. +            exit(1);
  54. +          }
  55. +/*        fseek(ifp,0,2);
  56. + *        if (ftell(ifp)< 120*160*3) { fclose(ifp); continue; }
  57. + *        fseek(ifp,0,0);  
  58. + */       break;
  59. +         }
  60. +WAITING  fprintf(stderr,"mpeg: got %s\n",fullFileName); 
  61.      }
  62.  
  63.      switch(baseFormat) {
  64. @@ -212,6 +225,8 @@
  65.      } else {
  66.      fclose(ifp);
  67.      }
  68. +WAITING  remove(fullFileName);
  69. +WAITING  fprintf(stderr,"mpeg: removed: %s\n",fullFileName);
  70.  
  71.  #ifdef BLEAH
  72.  time(&diskEndTime);
  73.  
  74.